package com.crm.crmback.web.controller;

import com.crm.crmback.model.MonthIncome;
import com.crm.crmback.service.ICourseOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;

@Controller
@RequestMapping("dataAnalysis")
public class DataAnalysisControler {

    //注入service，使用 ICouserOrderService 这个就可以
    @Autowired
    private ICourseOrderService orderService;
    /**
     * 用于跳转到收入页面的方法
     * @return
     */
    @RequestMapping("income")
    public String income(){
        return "dataanalysis/income";
    }

    /**
     *
     * @return
     */
    @RequestMapping("getMonthIcomes")
    @ResponseBody
    public List<MonthIncome> getMonthIcomes(){
        return orderService.getMonthIcomes();
    }
}
